let app = getApp();
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    title: {
      type: String,
      value: '',
    },
    control: {
      type: String,
      value: 'center',
    },
    backgroundColor: {
      type: String,
      value: '',
    },
    textClolor: {
      type: String,
      value: '',
    },
    goback: {
      type: String,
      value: '',
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    
  },
  created() {

  },
  attached: function () {
    var that = this;
    that.setNavSize();
  },
  /**
   * 组件的方法列表
   */
  methods: {
    navTo() {
      let p = getCurrentPages().length;
      if (p <= 1) {
        wx.switchTab({
          url: '/pages/index/index',
        })
      } else {
        wx.navigateBack({
          delta: 1,
          success: function (res) {
            wx.setStorageSync('returnFlag', true)
          }
        })
      }
    },

    setNavSize: function () {
      var that = this,
        sysinfo = wx.getSystemInfoSync(),
        statusHeight = sysinfo.statusBarHeight,
        isiOS = sysinfo.system.indexOf('iOS') > -1,
        navHeight;
        console.log(sysinfo)
      if (!isiOS) {
        navHeight = 48;
      } else {
        navHeight = 44;
      }
      that.setData({
        status: statusHeight,
        navHeight: navHeight
      })
    },
    updateDa(e){
      this.setData({
          cardIssuersCode:e.detail.cardIssuersCode
      })
    },
  }
})
